#include "Blocks/CarpetBlock.h"

namespace PocketSurvival
{
    bool CarpetBlock::isFaceTransparent(int32_t face, int32_t value)
    {
        return face != 5;
    }

    void CarpetBlock::getCreativeValues(std::vector<int32_t> &blockVec)
    {
        for (int32_t index = 0; index < 16; ++index)
        {
            blockVec.push_back(Terrain::MakeBlockValue(Index(), 0, index));
        }
    }

    void CarpetBlock::getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues)
    {
        if (toolLevel >= RequiredToolLevel)
        {
            int32_t data = Terrain::ExtractData(oldValue);
            dropValues.push_back(BlockDropValue{Terrain::MakeBlockValue(Index(), 0, data), 1});
        }
    }

    const std::vector<BoundingBox> &CarpetBlock::getCustomCollisionBoxes(int32_t value)
    {
        return BlockConstans::carpetCollisionBoxes;
    }

    int32_t CarpetBlock::getIndex()
    {
        return Index();
    }
    const std::string &CarpetBlock::getBlockName()
    {
        static std::string blockName = "CarpetBlock";
        return blockName;
    }

} // namespace PocketSurvival
